

#ifndef __INDEXBUFFER_GL15_H__
#define __INDEXBUFFER_GL15_H__

#include <GL/glew.h>
#include <gfx/iindexbuffer.h>

/**
 * \addtogroup opengl
 * @{
 */

/**
 * @brief OpenGL 1.5 implemenation of the iIndexBuffer interface.
 */
class ceIndexBufferGL15 : public iIndexBuffer
{
  CE_OBJECT
private:
  GLuint	name;

public:
  ceIndexBufferGL15 ();
  virtual ~ceIndexBufferGL15 ();

  bool CreateBuffer (unsigned size, const void* data, ceBufferDataMode mode);

  bool Copy (unsigned offset, unsigned size, const void* data);

  bool Lock (unsigned offset, void** buffer, ceBufferAccessMode mode);


  void Bind ();


  bool Unlock ();
};


/** @} */

#endif /* ! __INDEXBUFFER_GL15_H__ */
